package com.lidong.framework.model;

import java.util.HashMap;
import java.util.Map;

import com.lidong.framework.mybatis.query.ConditionQuery;
import com.lidong.framework.mybatis.util.ConditionUtil;

public class QueryPojo {

	public ConditionQuery buildConditionQuery() {
		ConditionQuery query = new ConditionQuery();
		query.addAll(ConditionUtil.getConditions(this));
		if (null != this.queryParamMap) {
			query.addAllParam(this.queryParamMap);
		}
		return query;
	}

	public void appendQueryParam(String key, Object value) {
		if (null == this.queryParamMap) {
			this.queryParamMap = new HashMap<String, Object>();
		}
		this.queryParamMap.put(key, value);
	}

	private Map<String, Object> queryParamMap = null;
}
